import request from '@/utils/request'

// 查询BOM成本测算列表
export function listCostcalc(query) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/list',
    method: 'get',
    params: query
  })
}

// 查询BOM成本测算列表
export function listCostcalc2(query) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/list2',
    method: 'get',
    params: query
  })
}

// 查询BOM成本测算详细
export function getCostcalc(fid) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/' + fid,
    method: 'get'
  })
}

// 新增BOM成本测算
export function addCostcalc(data) {
  return request({
    url: '/bomcostestimation/basebill/costcalc',
    method: 'post',
    data: data
  })
}

// 修改BOM成本测算
export function updateCostcalc(data) {
  return request({
    url: '/bomcostestimation/basebill/costcalc',
    method: 'put',
    data: data
  })
}

// 删除BOM成本测算
export function delCostcalc(fid) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/' + fid,
    method: 'delete'
  })
}


// 获取BOM下级
export function getMaterialBomAllNodes(fid,longCode) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/getMaterialBomAllNodes/' + fid+"/"+longCode,
    method: 'get',
    timeout: 60000
  })
}

// 单据状态操作
export function optionStatus(id,status) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/optionstatus/' + id + "/" + status,
    method: 'get'
  })
}


// 反写
export function reverse(id) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/reverse/' + id,
    method: 'get'
  })
}

// 获取系数
export function getBomCoffe(data) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/getBomCoffe',
    method: 'put',
    data: data
  })
}

// 移交产品库
export function moveProdect(id,isMove) {
  return request({
    url: '/bomcostestimation/basebill/costcalc/moveProdect/' + id + "/" + isMove,
    method: 'get'
  })
}
